Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update index after deploy #308

Closed
wants to merge 1 commit into from

Conversation

vncsna
Copy link
Contributor

@vncsna vncsna commented Aug 15, 2023

Update index after deploy

@vncsna vncsna changed the base branch from main to development August 15, 2023 20:33
nginx -g "daemon off;"
(cd /app; python manage.py makemigrations)
(cd /app; python manage.py migrate)
(cd /app; python manage.py update_index --remove)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • O ideal seria que isso fosse feito apenas quando uma label específica fosse adicionada ao deploy.
  • Nos testes que fiz, o update_index --remove era bem mais lento que o rebuild_index
  • Quando faço o rebuild na mão uso os parâmentros: python manage.py rebuild_index --batch-size 50 --workers 4 --verbosity 2 --noinput para evitar timeout ou falta de memória.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pelo que li o update index deveria ser mais rápido, vou dar uma olhada sobre. Você testou no ambiente de development/staging ou localmente?

@vncsna vncsna force-pushed the feat/update-index-after-deploy branch from 305462e to f361da6 Compare August 15, 2023 21:13
@vncsna vncsna force-pushed the feat/update-index-after-deploy branch from f361da6 to e450c8d Compare August 15, 2023 21:14
@vncsna
Copy link
Contributor Author

vncsna commented Aug 15, 2023

Tenho dúvida em relação ao ambiente atual. Se atualmente o container do elastic search já não é recriado após um deploy. Se sim, esse PR não tem sentido @guialvesp1 @gabriel-milan @d116626

@vncsna vncsna requested a review from guialvesp1 August 15, 2023 22:28
@guialvesp1
Copy link
Collaborator

Tenho dúvida em relação ao ambiente atual. Se atualmente o container do elastic search já não é recriado após um deploy. Se sim, esse PR não tem sentido @guialvesp1 @gabriel-milan @d116626

O container do elastisearch não é recriado em nenhum momento.

@mfagundes
Copy link
Collaborator

O container do elastisearch não é recriado em nenhum momento.

Além disso, registro aqui o que falamos na última daily: o pod de produção não deve fazer o rebuild ou o update, uma vez que são réplicas e isso levaria a duas indexações simultâneas.

@vncsna
Copy link
Contributor Author

vncsna commented Aug 17, 2023

Vou fechar o PR, essa não parece uma alternativa viável

@vncsna vncsna closed this Aug 17, 2023
@vncsna vncsna deleted the feat/update-index-after-deploy branch September 25, 2023 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants